package kr.hkit.powerjava.chapter08.work;
/* LAB Box클래스를 작성해라 */
class Box{
	int width;					
	int length;
	int height;
	
	public int getWidth() {
		return width;
	}
	public void setWidth(int width) {
		this.width = width;
	}
	public int getLength() {
		return length;
	}
	public void setLength(int length) {
		this.length = length;
	}
	public int getHeight() {
		return height;
	}
	public void setHeight(int height) {
		this.height = height;
	}
	void getVolume(){
		System.out.println("박스의 부피는 : " + this.width*this.length*this.height); 
	}
	void print(){
		System.out.println("가로 : "+getWidth()+" 세로 : "+getLength()+" 높이 : "+getHeight());
	}
	@Override
	public String toString() {
		return "Box [width=" + width + ", length=" + length + ", height="
				+ height + "]";
	}
}//end of Box Class
public class BoxTest {
	public static void main(String[] args) {
		Box box1 = new Box();
		Box box2 = new Box();
		box1.setWidth(100);
		box1.setLength(100);
		box1.setHeight(100);
		box1.getVolume();
		
		box2.setWidth(200);
		box2.setLength(200);
		box2.setHeight(200);
		
		box1 = box2;
		box1.getWidth();
		box1.getLength();
		box1.getHeight();
		
		box1.print();
		System.out.println(box1);
	}
}//end of BoxTest Class
